﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

using Invini.System.Enums;

namespace Invini.System.Structures
{
    [StructLayout(LayoutKind.Sequential)]
    public struct RawInputDevice
    {
        /// <summary>
        /// Top level collection Usage page for the raw input device.
        /// For usage pages, see the USB Serial Bus HID Usage Tables document
        /// at http://www.usb.org/developers/devclass_docs/Hut1_12.pdf.
        /// </summary>
        [MarshalAs(UnmanagedType.U2)]
        public HIDUsagePage UsagePage;

        /// <summary>
        /// Top level collection Usage for the raw input device.
        /// For usage types, see the USB Serial Bus HID Usage Tables document
        /// at http://www.usb.org/developers/devclass_docs/Hut1_12.pdf.
        /// </summary>
        [MarshalAs(UnmanagedType.U2)]
        public HIDUsage Usage;

        /// <summary>
        /// Mode flag that specifies how to interpret the information provided
        /// by the usUsagePage and usUsage. It can be zero (the default) or
        /// one of the following values. By default, the operating system
        /// sends raw input from devices with the specified top level
        /// collection (TLC) to the registered application as long as it has
        /// the window focus.
        /// </summary>
        [MarshalAs(UnmanagedType.U4)]
        public RawInputDeviceFlags Flags;

        /// <summary>
        /// Handle to the target window. If NULL, it follows the keyboard
        /// focus.
        /// </summary>
        public IntPtr Target;
    }
}
